Optimal. Leaf size=92 \[ \frac {1}{2} (A b+a B+2 b C) x+\frac {(2 a A+3 b B+3 a C) \sin (c+d x)}{3 d}+\frac {(A b+a B) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a A \cos ^2(c+d x) \sin (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {4159, 4132,
2717, 4130, 8} \begin {gather*} \frac {\sin (c+d x) (2 a A+3 a C+3 b B)}{3 d}+\frac {(a B+A b) \sin (c+d x) \cos (c+d x)}{2 d}+\frac {1}{2} x (a B+A b+2 b C)+\frac {a A \sin (c+d x) \cos ^2(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2717
Rule 4130
Rule 4132
Rule 4159
Rubi steps
\begin {align*} \int \cos ^3(c+d x) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {a A \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{3} \int \cos ^2(c+d x) \left (-3 (A b+a B)-(2 a A+3 b B+3 a C) \sec (c+d x)-3 b C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a A \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{3} \int \cos ^2(c+d x) \left (-3 (A b+a B)-3 b C \sec ^2(c+d x)\right ) \, dx-\frac {1}{3} (-2 a A-3 b B-3 a C) \int \cos (c+d x) \, dx\\ &=\frac {(2 a A+3 b B+3 a C) \sin (c+d x)}{3 d}+\frac {(A b+a B) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a A \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{2} (-A b-a B-2 b C) \int 1 \, dx\\ &=\frac {1}{2} (A b+a B+2 b C) x+\frac {(2 a A+3 b B+3 a C) \sin (c+d x)}{3 d}+\frac {(A b+a B) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a A \cos ^2(c+d x) \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.22, size = 85, normalized size = 0.92 \begin {gather*} \frac {6 A b c+6 a B c+6 A b d x+6 a B d x+12 b C d x+3 (3 a A+4 b B+4 a C) \sin (c+d x)+3 (A b+a B) \sin (2 (c+d x))+a A \sin (3 (c+d x))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 102, normalized size = 1.11
method | result | size |
risch | \(\frac {A b x}{2}+\frac {a B x}{2}+b x C +\frac {3 a A \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (d x +c \right ) b B}{d}+\frac {\sin \left (d x +c \right ) a C}{d}+\frac {a A \sin \left (3 d x +3 c \right )}{12 d}+\frac {A b \sin \left (2 d x +2 c \right )}{4 d}+\frac {B a \sin \left (2 d x +2 c \right )}{4 d}\) | \(101\) |
derivativedivides | \(\frac {\frac {a A \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+A b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b B \sin \left (d x +c \right )+a C \sin \left (d x +c \right )+C b \left (d x +c \right )}{d}\) | \(102\) |
default | \(\frac {\frac {a A \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+A b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b B \sin \left (d x +c \right )+a C \sin \left (d x +c \right )+C b \left (d x +c \right )}{d}\) | \(102\) |
norman | \(\frac {\left (\frac {1}{2} A b +\frac {1}{2} B a +C b \right ) x +\left (\frac {1}{2} A b +\frac {1}{2} B a +C b \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {1}{2} A b +\frac {1}{2} B a +C b \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {1}{2} A b +\frac {1}{2} B a +C b \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A b -B a -2 C b \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A b -B a -2 C b \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (2 a A -A b -B a +2 b B +2 a C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (2 a A +A b +B a +2 b B +2 a C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 \left (4 a A -3 A b -3 B a \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 \left (4 a A +3 A b +3 B a \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {4 \left (a A -3 b B -3 a C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}\) | \(328\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 98, normalized size = 1.07 \begin {gather*} -\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A b - 12 \, {\left (d x + c\right )} C b - 12 \, C a \sin \left (d x + c\right ) - 12 \, B b \sin \left (d x + c\right )}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.10, size = 70, normalized size = 0.76 \begin {gather*} \frac {3 \, {\left (B a + {\left (A + 2 \, C\right )} b\right )} d x + {\left (2 \, A a \cos \left (d x + c\right )^{2} + 2 \, {\left (2 \, A + 3 \, C\right )} a + 6 \, B b + 3 \, {\left (B a + A b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 227 vs.
\(2 (84) = 168\).
time = 0.51, size = 227, normalized size = 2.47 \begin {gather*} \frac {3 \, {\left (B a + A b + 2 \, C b\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.04, size = 100, normalized size = 1.09 \begin {gather*} \frac {A\,b\,x}{2}+\frac {B\,a\,x}{2}+C\,b\,x+\frac {3\,A\,a\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,b\,\sin \left (c+d\,x\right )}{d}+\frac {C\,a\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {A\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________